1. Field of the Invention
The present invention relates to an image processing apparatus and a method of processing an image and, more specifically, relates to technology for coding still image data and moving image data in a highly efficient manner.
2. Description of the Related Art
Recently, methods for coding moving images, such as the Moving Picture Experts Group phase 2 (MPEG-2) (conforming to International Organization for Standardization (ISO)/International Electro-technical Commission (IEC) 13818), are at wide use in the fields of storage, communication, and broadcasting. According to such a method, each frame image is divided into a plurality of coded blocks. Then, a frame image or a plurality of frame images is orthogonally transformed and the transformation coefficient is quantized to reduce the amount of data corresponding to an image. Variable length coding is carried out on the reduced image data. When carrying out this process, the amount of data can be significantly reduced by using a large quantization coefficient. However, the use of a large quantization coefficient causes quantization error to be great, significantly reducing the image quality due to distortion, such as block distortion and/or mosquito noise. For still images, the Joint Photographic Experts Group (JPEG) coding method is most widely used. Similarly, when compressing a still image into a considerably small file size, quantization error is increased, causing block distortion and/or mosquito noise.
A pre-filter is known for decreasing quantization error. A pre-filter carries out processing, such as low-pass filter processing, on an input image to reduce the amount of data of the image before the image is sent to a coding device. Throughout an image, regions including a large amount of data and regions including a relatively small amount of data are unevenly distributed. Therefore, filter processing of the image can be efficiently and accurately carried out by changing the property of the filters used for the processing in accordance with the region of the image to be processed. Japanese Patent Laid-Open No. 9-298753 describes a method of coding moving images and a moving image coding apparatus capable of changing the property of a low-pass filter in accordance with the local differences in prediction errors to improve the subjective image quality.
Japanese Patent Laid-Open No. 8-18977 describes a method of improving the subjective image quality by changing the property of a low-pass filter in accordance with local differences in prediction errors.
However, according to the method described in Japanese Patent Laid-Open No. 9-298753, the filter property in changed for each region only on the basis of an analysis of the input image. According to this known method, the optimal image quality is not always achieved for the target code length because, if the target code length is set high, a pre-filter is not required or a weak pre-filter may be used, and, if the target code length is set low, a strong pre-filter is required. For this reason, satisfactory filter control is not possible when the control is only based on the characteristics of the input image.
Moreover, Japanese Patent Laid-Open No. 9-298753 describes a process for preventing degradation in the subjective image quality due to an extreme difference in the properties of filters used for processing adjacent blocks in an image. In this case, also, the difference in the properties of filter used for processing adjacent blocks depends on the target code length. Therefore, even if a fixed value is used, it is difficult to achieve optimal image quality.
The moving image coding and decoding apparatus described in Japanese Patent Laid-Open No. 8-18977 processes regions of an image where movement compensation is unpredictable using a strong filter. For this reason, when a scene change occurs, the image provided immediately after the scene change is processed with a strong filter, whereas the following images are processed with a weak filter.
However, according to the moving image coding and decoding apparatus described in Japanese Patent Laid-Open No. 8-18977, when the moving image includes a frame image capturing light from a flash, this frame image is processed with a strong filter, and the following frame images not including the light from a flash are also processed with a strong filter.
As a result, the frame image immediately before the flash and the frame immediately after the flash will have significantly different image qualities since the two frame images are processed with different filters even though they are strongly correlated with each other. This difference in image quality causes a significant reduction in the efficiency of coding performed on the subsequent frame images.